package com.example.easybuy.pojo;

import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class User {
    //用户id
    private int id;
    //登录名
    private String loginName;
    //用户名
    private String userName;
    //登录密码
    private String password;
    //性别：1：男，0：女
    private int sex;
    //身份证号
    private String identityCode;
    //邮箱
    private String email;
    //手机号
    private String phonenum;
    //用户类型：1：管理员，0：普通用户
    private int type;


    //登录状态
    private String loginStatus ;

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", loginName='" + loginName + '\'' +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", sex=" + sex +
                ", identityCode='" + identityCode + '\'' +
                ", email='" + email + '\'' +
                ", phonenum='" + phonenum + '\'' +
                ", type=" + type +
                ", loginStatus='" + loginStatus + '\'' +
                '}';
    }

    public String getLoginStatus() {
        return loginStatus;
    }

    public void setLoginStatus(String loginStatus) {
        this.loginStatus = loginStatus;
    }
    /*判断1是男，0是女 方法*/
//    public String isSex(){
//        String sexStr=null;
//        if (sex==1){
//            sexStr="男";
//        }else{
//            sexStr="女";
//        }
//        return sexStr;
//    }

    /*判断1是管理员，0是普通用户 方法*/
//    public String isType(){
//        String typeStr=null;
//        if (type==1){
//            typeStr="管理员";
//        }else{
//            typeStr="普通用户";
//        }
//        return typeStr;
//    }

    /*getter、setter方法*/
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public String getIdentityCode() {
        return identityCode;
    }

    public void setIdentityCode(String identityCode) {
        this.identityCode = identityCode;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhonenum() {
        return phonenum;
    }

    public void setPhonenum(String phonenum) {
        this.phonenum = phonenum;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

}
